﻿@model WebEditor.Models.Create

@{
    ViewBag.Title = "New Game";
}

@section scripts {
    <script src="@Url.Content("~/Scripts/GameNew.js")" type="text/javascript"></script>
}

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true, "Unable to create game. Please correct the errors below.")
    <div>
        <div class="editor-label">
            @Html.LabelFor(m => m.GameName):
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(m => m.GameName, new { style = "width: 300px" })
            @Html.ValidationMessageFor(m => m.GameName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.SelectedType):
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(m => m.SelectedType, new SelectList(Model.AllTypes, Model.SelectedType))
            @Html.ValidationMessageFor(m => m.SelectedType)
        </div>

        <div id="templateSection">
            <div class="editor-label">
                @Html.LabelFor(m => m.SelectedTemplate):
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(m => m.SelectedTemplate, new SelectList(Model.AllTemplates, Model.SelectedTemplate))
                @Html.ValidationMessageFor(m => m.SelectedTemplate)
            </div>
        </div>

        <p>
            <button id="submit-button" type="submit">Create</button>
        </p>
    </div>
}